package com.sm.sales_management.service.impl;

import com.sm.sales_management.domain.Commodity;
import com.sm.sales_management.mapper.CommodityMapper;
import com.sm.sales_management.service.ICommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CommodityServiceImpl implements ICommodityService {

    @Autowired
    CommodityMapper commodityMapper;
    @Override
    public List<Commodity> selectAllCommodity() {
        return commodityMapper.selectAllCommodity();
    }

    @Override
    public Integer delete(int id) {
        return commodityMapper.delete(id);
    }

    @Override
    public Integer updateCommodity(Commodity commodity) {
        return commodityMapper.updateCommodity(commodity);
    }

    @Override
    public Integer insertCommodity(Commodity commodity) {
        return commodityMapper.insertCommodity(commodity);
    }
}
